package com.heima.article.controller.v1;

import com.heima.article.service.IApCollectionService;
import com.heima.model.behavior.dto.BehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date 2024/8/22 11:00
 * @Author JinCc
 * @Description TODO
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/v1")
public class CollectionController {

    @Autowired
    private IApCollectionService collectionService;

    /**
     * 文章收藏
     * @param dto
     * @return
     */
    @PostMapping("/collection_behavior/")
    public ResponseResult collection(@RequestBody BehaviorDto dto){
        return collectionService.collection(dto);
    }

    /**
     * 文章行为数据回显
     * @param dto
     * @return
     */
    @PostMapping("/article/load_article_behavior/")
    public ResponseResult loadArticleBehavior(@RequestBody BehaviorDto dto){
        return collectionService.loadArticleBehavior(dto);
    }
}
